<template>
	<view class="content">
		<view class="panel_box">
			<view class="seach_box">
				<view class="search">
					<view class="icon_search"><uni-icons :type="icons[0].type" color="#333333" :size="icons[0].size" /></view>
					<view class="search_input">
						<input v-model="params.customer_name" @input="seachCustomer" placeholder-style="font-size:26rpx" placeholder="关键字搜索" value="" />
					</view>
					<view class="icon_search"></view>
				</view>
				<view class="seach_info" @click="seachCustomer">搜索</view>
			</view>
		</view>
		
		
		<view class="panel_box">
			<view class="box_title">
				<view class="title_left">客户分类</view>
			</view>
		</view>
		
		<view class="panel_box">
			<view class="scroll_nav">
				<scroll-view class="scroll-view_H" scroll-x="true" scroll-left="0">
					<view class="scroll-view-item_H" v-for="(item,index) in navList" :key="index"   :class="tabSubItem == index ? 'cur' : ''" :data-id="index"  @click="selectTab">
						<view class="scroll-view-title">{{item}}</view>
					</view>
				</scroll-view>
			</view>
		</view>
		
		<view class="panel_box">
			<view class="box_title">
				<view class="title_left">客户列表</view>
			</view>
		</view>
		
		<view class="panel_box" v-for="(item,index) in dataList" :key="index" >
			<view class="panel_item">
				<view class="box_content">
					
					<view class="popup_list_item">
						<view class="item_left">
							<view class="item_left_top">
								<view class="item_title">{{item.customer_name}}</view>
								
								<view class="item_type" >{{item.customer_kind}}</view>
							</view>
							<view class="item_left_bottom">
								<view class="left_bottom_box">
									电话：{{item.tel}}
								</view>
								<view class="left_bottom_box">
									{{item.address}}
								</view>
							</view>
						</view>
						
					</view>
					
				</view>
	
	
				<view class="panel_bottom_txt">
					<text v-if="item.contacts">联系人：{{item.contacts}}</text>
					
					<text v-if="item.short_name">,客户简称：{{item.short_name}}</text>
					<text v-if="item.customer_code">,客户编码：{{item.customer_code}}</text>
				</view>
	
				<view class="product_opt">
					<view class="button_box" v-if="item.is_sync==1">
						<button type="default" size="mini" @click="deleteData(item.id)">删除客户</button>				
					</view>
					<view class="button_box"  v-if="item.id">
						<button type="default" size="mini" @click="addPage(item.id)" >修改客户</button>				
					</view>
				</view>
			</view>
		</view>
		
		<view v-if="dataList.length==0" class="empty_box">
			暂无数据
		</view>
		
		
	</view>
</template>


<script>
	import  parentPage from '@/common/parent-page.js';
	import {index} from './index.js';
	export default {mixins: [parentPage,index]}
</script>



<style>
	@import './index.css';
</style>
